package com.wontube.client.extension.utils;

/**
 * @author tanggf(2012-3-30)
 *
 */
public class NumberUtils {
	/**
	 * default to 0
	 * @param num
	 * @return
	 */
	public static int parseInt(String num){
		return parseInt(num, 0);
	}
	
	public static int parseInt(String num, int defaultVal){
		if(StringUtils.isDigit(num)){
			return Integer.parseInt(num);
		}
		return defaultVal;
	}
}
